<?php

namespace App\Containers\AppSection\Moneybox\UI\API\Requests;

use App\Ship\Parents\Requests\Request;
use Illuminate\Validation\Rule;

class IdentificationRequest extends Request
{
    /**
     * Define which Roles and/or Permissions has access to this request.
     */
    protected array $access = [
        'permissions' => '',
        'roles' => '',
    ];

    /**
     * Id's that needs decoding before applying the validation rules.
     */
    protected array $decode = [
        // 'id',
    ];

    /**
     * Defining the URL parameters (e.g, `/user/{id}`) allows applying
     * validation rules on them and allows accessing them like request data.
     */
    protected array $urlParameters = [
        // 'id',
    ];

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            "uuid" => ["required", "uuid", "string"],
            "account" => ["required", "string"],
            "amount" => ["required", "string"],
            "bik" => ["required", "string"],
            "inn" => ["string"],
            "kpp" => ["string"],
            "name" => ["required", "string"],
            "payment_destination" => ["required", "string"],
            "transaction_date" => ["required", "string"],
            "transaction_uid" => ["required", "uuid", Rule::unique('moneybox_in', 'transaction_uid')],

            "commission" => ["nullable", "string"],
            "acquiring_commission" => ["nullable", "string"],
            "acquiring_payment_id" => ["nullable", "string"],
            "c2b_qr_code_id" => ["nullable", "string"]
        ];
    }

    public function messages(): array
    {
        return [];
    }

    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return $this->check([

        ]);
    }
}
